package com.ruyuan.ingestion.parser;

import com.ruyuan.ingestion.common.Parsable;

public abstract class UserFriendParser<T> implements Parsable<T> {

    @Override
    public Boolean isHeader(String[] fields) {
        return (isValid(fields)
                && fields[0].equals("user_id")
                && fields[1].equals("friend_id")
        );
    }

    @Override
    public Boolean isValid(String[] fields) {
        return (fields.length)>1 && !isEmpty(fields,new int[]{0,1});
    }
}
